<template>
  <view class="vipdesk">
    <view class="vipdesk-content">
      <view class="vipdesk-box">
        <image src="@/static/image/vip.png" mode="" />
      </view>
    </view>
  </view>
  <view class="vip-button">
    <view class="button">
      <button @click="submitMoneyChange">立即升级VIP</button>
    </view>
  </view>
</template>
<script setup>
import { ref } from "vue";
import { postVip, getVipImg } from "@/api/apiList";
const submitMoneyChange = async () => {
  // 微信支付
  const ua = navigator.userAgent.toLowerCase();
  if (ua.match(/MicroMessenger/i) == "micromessenger") {
    uni.setStorageSync("palyType", "vip");
    // 跳转页面
    uni.navigateTo({
      url: "/pages/forSale/pages/weixinPay",
    });
  } else {
    return uni.showToast({
      title: "请前往微信公众号号进行支付",
      icon: "none",
    });
    // uni.setStorageSync("resFrom", res.msg || res.data);
    uni.navigateTo({
      url: "/pages/forSale/pages/Alipay",
    });
  }
  return;

  const res = await postVip();
  console.log(res);
  if (res.code == 200) {
    if (res.msg || res.data) {
    }
  }
};
const configValue = ref();
const submitContent = async () => {
  const res = await getVipImg();
  if (res.code == 200) {
    configValue.value = res.data.configValue;
  }
};
submitContent();
</script>
<style lang="scss" scoped>
.vipdesk-box {
  image {
    width: 100%;
    height: 100vh;
  }
}

.vip-button {
  position: fixed;
  bottom: 30rpx;
  width: 100%;

  .button {
    margin: 0 30rpx;
    line-height: 40rpx;

    button {
      display: flex;
      justify-content: center;
      align-items: center;
      line-height: 40rpx;
      height: 40px;
      border-radius: 20px;
      font-family: PingFang SC Bold;
      font-size: 16px;
      color: #8c5430;
      background: linear-gradient(270deg, #d0a380 1%, #f9e6d5 98%);
    }
  }
}

page {
  background: #11100e;
}
</style>
